hook::add incoming_invite in_invite 5
proc in_invite {from fromjid cjid reason} {
	if {[config::optionenable invite]} {
		set ifadm [ifadmin $fromjid]
		if {$ifadm>4} {
			if {$reason==""} {
				set reason "invited by $from"
			}
			set tmp [config::name def]
			set out "<presence to='$cjid/$tmp' xml:lang='ru'><status>$reason</status><x xmlns='http://jabber.org/protocol/muc'><history maxchars='0' maxstanzas='0'/></x></presence>"
			config::addnametolist $cjid $tmp
			config::addconftolist $cjid
			jlib::outmsg $out
			return stop
		} else {
			puts ifadm<4
		}
	}
}